/**
 * 
 */
package com.repository.service;

import java.util.List;

import com.repository.model.User;

/**
 * Service interface to perform CRUD and List operations on
 * {@link User}
 * @author lovkeshsingh
 *
 */
public interface UserRepositoryService {
	
	public User getUserById(long userId);
	
	/**
	 * Add new user to the repository
	 * @param user
	 * @return true on success
	 */
	public Long addUser(String userName, String password);
	
	/**
	 * Remove an existing user from repository
	 * @param user
	 * @return true on deletion
	 */
	public void removeUser(Long id);
	
	/**
	 * Update existing user records
	 * @param user
	 * @return
	 */
	public Long updateUser(Long id, String userName, String password);
	
	/**
	 * List all users in the repository
	 * @return {@link List} of {@link User} objects
	 */
	public List<User> getUserList();

	/**
	 * Returns the user from persistant store by looking up the userName
	 * @param userName
	 * @return {@link User} or null if user not found
	 */
	public User getUserByUserName(String userName);
	
	
}
